import Vue from 'vue'
import App from './App.vue'
import router from './router'
// import './plugins/element.js'
import './assets/css/gloable.css'
import './assets/font/iconfont.css'
import TreeTable from 'vue-table-with-tree-grid'

import VueQuillEditor from 'vue-quill-editor'
// 引入axios
import axios from 'axios'
import { Tree } from 'element-ui'
// 设置默认访问地址
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'

// 设置请求拦截器
axios.interceptors.request.use(config => {
        config.headers.Authorization = window.sessionStorage.getItem('token')
        return config
    })
    // 给Vue挂载
Vue.prototype.$http = axios

Vue.config.productionTip = false

Vue.use(VueQuillEditor)

Vue.component('tree-table', TreeTable)

Vue.filter('dateFormate', function(ori) {
    const gt = new Date(ori)
    const y = gt.getFullYear()
    const m = (gt.getMonth() + 1 + '').padStart(2, '0')
    const d = (gt.getDate() + '').padStart(2, '0')

    const hh = (gt.getHours() + '').padStart(2, '0')
    const mm = (gt.getMinutes() + '').padStart(2, '0')
    const ss = (gt.getSeconds() + '').padStart(2, '0')
    return `${y}-${m}-${d}  ${hh}:${mm}:${ss}`
})

new Vue({
    router,
    render: h => h(App)
}).$mount('#app')